package com.design.pattern.test;

import org.springframework.context.annotation.Scope;

/**
 * 贷款接口实现类
 *
 * @author xsj
 * @verion 1.0.0
 * 2022/8/29 11:13
 */
@Scope("prototype")
public class LoansBuilderImpl implements LoansBuilder {
    /**
     * 构建的复杂对象
     */
    private LoansInfo loansInfo =new LoansInfo();

    @Override
    public LoansBuilder builderBase() {
        loansInfo.setBase("实现第1部分基础信息的构建");
        return this;
    }

    @Override
    public LoansBuilder builderWork() {
        loansInfo.setWork("实现第2部分工作信息的构建");
        return this;
    }

    @Override
    public LoansBuilder builderBank() {
        loansInfo.setBank("实现第3部分银行信息的构建");
        return this;
    }



    @Override
    public LoansInfo builder() {
        System.out.println("最终得到一个完整的复杂对象");
        return loansInfo;
    }
}